<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="javax.naming.*" %>
<%
	Connection conn=null;
	PreparedStatement stmt=null;
	ResultSet rs=null;
	
	String infoString = "";
	
	try {
		
		//Connection Pool 이용
		//Context init=new InitialContext();
		//DataSource ds=(DataSource)init.lookup("java:comp/env/jdbc/OracleDB");
		//conn=ds.getConnection();
		 
		String driver="oracle.jdbc.driver.OracleDriver";
		String url="jdbc:oracle:thin:@oracle.miraeis02.cafe24.com:1521:orcl";
		String uid="miraeis02";
		String pwd="miraejikim02";
		
		Class.forName(driver).newInstance();
		conn=DriverManager.getConnection(url, uid, pwd);
		
		stmt=conn.prepareStatement("select * from tMember");
		rs=stmt.executeQuery();
				
		while(rs.next()) {
			infoString += rs.getString("member_name") +" ("+ rs.getString("member_id") +").<br />";
		}			
		
	} catch(Exception e) {
		e.printStackTrace();
	} finally {
		try {
			rs.close();
		} catch(SQLException e) {
		}
		try {
			stmt.close();
		} catch(SQLException e) {
		}
		try {
			conn.close();
		} catch(SQLException e) {
		}
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MVC1 Sample List</title>
</head>
<body>

<%=infoString %>
<br />
EL : ${infoString}

</body>
</html>